#include<stdio.h>
#include<unistd.h>
#include<string.h>
#include<fcntl.h>


int main(){
    int fd = open("../fifo",O_RDONLY);
    if(fd<0){
        perror("open");
        return 0;
    }
    while(1){
    char buf[1024]={0};
    read(fd,buf,sizeof(buf)-1); 
    printf("buf is %s\n",buf);
    sleep(2);
    }
    return 0;
}
